package com.itheima.tlias84.mapper;


import com.itheima.tlias84.dto.SelectAllStudentsDTO;
import com.itheima.tlias84.dto.SelectStudentDTO;
import com.itheima.tlias84.po.InsertStudentsParam;
import com.itheima.tlias84.po.SelectStudentsPageParam;
import com.itheima.tlias84.po.UpdateStudentParam;
import com.itheima.tlias84.po.ViolationParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface StudentsMapper {

    /**
     * 分页查询
     * @param param
     * @return
     */
    List<SelectAllStudentsDTO> selectAllStudents(@Param("p")SelectStudentsPageParam param);


    /**
     * 根据id删除班级
     * @param ids
     * @return
     */
    int deleteById(@Param("ids") List<Integer> ids);

    /**
     * 添加
     * @param param
     * @return
     */
    int insertStudents(@Param("p")InsertStudentsParam param);

    /**
     * 通过id查询
     * @param id
     * @return
     */
    SelectStudentDTO selectStudentById(@Param("id") Integer id);

    /**
     * 修改
     * @param param
     * @return
     */
    int updateStudent(@Param("p")UpdateStudentParam param);

    /**
     * 修改违纪分
     * @param id,score
     * @return
     */
    int updateViolation(@Param("id")Integer id,@Param("score") Integer score);

}
